﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="2_TestVerifyCode.aspx.cs"
    Inherits="PSSsoft.Web._2_TestVerifyCode" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>第二种验证码测试方式</title>
    <script type="text/javascript">
        function reloadcode() {
            //在reloadcode函数中，我们在VerifyCode2.ashx后面加了一个随机参数，这样每次的链接地址都不一样，从而达到更新的目的。
            document.getElementById("imgValidateCode").setAttribute("src", "VerifyCode2.ashx?parmTemp=" + Math.random());
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <ul>
            <li>验证码:<input id="txtVerifyCode" type="text" runat="server" maxlength="4" name="txtVerifyCode" />
                <img alt="验证码" src="VerifyCode2.ashx" id="imgValidateCode" /><a href="javascript:reloadcode()">看不清，换一张</a></li>
            <li>
                <asp:Button ID="btnTestVeriryCode" runat="server" Text="测试验证码" OnClick="btnTestVeriryCode_Click" />
            </li>
        </ul>
    </div>
    </form>
</body>
</html>
